<!DOCTYPE html>
<html class="x-admin-sm">

<head>
  <meta charset="UTF-8">
  <title></title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8" />
  <link rel="stylesheet" href="./css/font.css">
  <link rel="stylesheet" href="./css/xadmin.css">
  <link rel="stylesheet" href="./css/cate.css">
  <script src="./js/jquery.min.js"></script>
  <!-- <script src="./js/baseApi.js"></script> -->
  <script src="./lib/layui/layui.all.js" charset="utf-8"></script>
  <script type="text/javascript" src="./js/xadmin.js"></script>
  <!--[if lt IE 9]>
          <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
          <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
  <script src="./lib/template-web.js"></script>
  <script src="./js/cate.js"></script>
</head>

<body>
  <div class="x-nav">
    <span class="layui-breadcrumb">
      <a href="">首页</a>
      <a href="">演示</a>
      <a>
        <cite>导航元素</cite></a>
    </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
      onclick="location.reload()" title="刷新">
      <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
  </div>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-tab layui-tab-card">
        <ul class="layui-tab-title">
          <li class="layui-this layui-bg-red">分类列表</li>
          <li>添加分类</li>
        </ul>
        <div class="layui-tab-content" style="height: 100px;">
          <div class="layui-tab-item layui-show">
            <table class="layui-table">
              <colgroup>
                <col width='100px'>
                <col width='300px'>
                <col>
                <col>
                <col width='200px'>
              </colgroup>
              <thead>
                <tr>
                  <th>编号</th>
                  <th>ID</th>
                  <th>名称</th>
                  <th>文章数量</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody>
              </tbody>
            </table>
            <div id="pageBox"></div>
          </div>
          <div class="layui-tab-item">
            <form class="layui-form add-form" action="">
              <div class="layui-form-item">
                <label class="layui-form-label">分类名称</label>
                <div class="layui-input-block">
                  <input type="text" name="title" required lay-verify="required" placeholder="请输入分类名" autocomplete="off"
                    class="layui-input addClassification">
                </div>
              </div>
              <div class="layui-form-item">
                <div class="layui-input-block">
                  <button class="layui-btn layui-btn-danger layui-btn-lg" lay-submit lay-filter="formDemo">立即创建</button>
                  <button type="reset" class="layui-btn layui-btn-primary layui-btn-lg">取消</button>
                </div>
              </div>
            </form>
          </div>
        </div>
      </div>
    </div>
  </div>

  <!-- 表格数据的模板 -->
  <script type="text/html" id="mo-table">
  {{each data}}
  <tr>
    <td>{{$index+1}}</td>
    <td class='data_id'>{{$value.id}}</td>
    <td>{{$value.catename}}</td>
    <td>{{$value.num}}</td>
    <td>
      <button type="button" class="layui-btn layui-btn-xs edit">编辑</button>
      <button type="button" class="layui-btn layui-btn-xs layui-btn-danger delete">删除</button>
    </td>
  </tr>
  {{/each}}
 </script>

  <script type="text/html" id="dialog-change">
    <form class="layui-form change-from" action="" style='margin-top:50px'>
        <div class="layui-form-item">
          <label class="layui-form-label">分类名称</label>
          <div class="layui-input-block">
            <input type="text" name="title" required  lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input change_content">
          </div>
        </div>  
        <div class="layui-form-item">
            <div class="layui-input-block">
              <button class="layui-btn layui-btn-lg layui-btn-danger" lay-submit lay-filter="formDemo">确定修改</button>
              <button type="reset" class="layui-btn layui-btn-primary layui-btn-lg" id='excit'>取消</button>
            </div>
          </div>    
    </form>
 </script>
</body>
<script>
</script>

</html>